import { request } from '@/utils/request';
import CRUD from '@/utils/request/CRUD';

// 单品订单CRUD
export const singleProductOrderCRUD = CRUD('/system/single-product-order');


// 申请单品延期
export function approvalYanqiSingleProductContract(data: Record<string, any>) {
  return request.post({
    url: '/system/single-product-order/approval-yanqi',
    data,
  });
}

// 保存设计信息
export function createSingleDesignInfo(data: Record<string, any>) {
  return request.post({
    url: '/system/single-product-order/save-design-info',
    data,
  });
}

// 获取设计信息列表
export function getSingleDesignInfoList(params: Record<string, any>) {
  return request.get({
    url: '/system/single-product-order/get-design-info',
    params,
  });
}

// 单品订单合同CRUD
export const singleProductContractCRUD = CRUD('/system/single-product-contract');

// 单品合同审批
export function approvalSingleProductContract(data: Record<string, any>) {
  return request.post({
    url: '/system/single-product-contract/approval',
    data,
  });
}
// 更新单品进度
export function updateSingleProductContractProgress(data: Record<string, any>) {
  return request.post({
    url: '/system/single-product-contract/update-progress',
    data,
  });
}
// 审核单品下单
export function singleProductContractApproval(data: Record<string, any>) {
  return request.post({
    url: '/system/single-product-contract/approval-place-an-order',
    data,
  });
}
// 订单id获得产品订单
export function getSingleProductOrderbyOrderid(params: Record<string, any>) {
  return request.get({
    url: '/system/single-product-order/get-by-orderid',
    params,
  });
}
